1. Field of the Invention
The present invention relates to a memory system having a nonvolatile semiconductor memory and a controller.
2. Description of the Related Art
Data storage apparatuses (memory systems) include a data storage medium, a host device, and a control device that performs transmission and reception of data between the host device and the data storage medium. In such a data storage apparatus, by providing a cache memory (a read cache function) that can be accessed quicker than the data storage medium, access performance from the host device is enhanced.
In a data storage apparatus having a cache memory, by using a prefetch function for data in the data storage medium when a sequential read request is received from the host device, the access performance is enhanced.
The prefetch function for data is a function of reading data in a sequential area (a subsequent area) from the data storage medium into the cache memory in advance when a read request issued from the host device has sequentiality. The sequentiality represents that a read request with respect to a subsequent data area is to be issued in sequence. When a read request having sequentiality is issued from the host device and the prefetch of data is to be performed, data in the sequential subsequent area for which a read request is expected to be issued is read from the data storage medium into the cache memory in advance prior to reception of a read request therefor from the host device.
A data storage medium described in Japanese Patent Laid-open No. 2007-241927 determines that a read request has sequentiality when the transfer size of a read request from a host computer is equal to a prefetch determination size set in advance, and prefetches, while transmitting data requested by the read request to the host computer, data in a subsequent storage area that continues from the data corresponding to the read request from a storage device to a cache memory.
However, in the technique disclosed in Japanese Patent Laid-open No. 2007-241927, there is a problem that it takes a long time to read data by the host device as a result of late start of data transfer to the host device, because it takes a long time for a search process to determine whether requested data is stored in the cache memory. Such a problem also occurs in a solid state drive (SSD) on which a nonvolatile semiconductor memory such as a NAND flash memory is mounted. Specifically, in an SSD that is configured to read data at a high speed from a flash memory by providing a cache memory between the flash memory and a host device, it takes a long time for a searching process to determine whether data for which a data request has been issued by the host device is stored in the cache memory, and therefore, it takes a long time for the host device to read data.